$(document).ready(function () {
    $("<div class=\"m-modal\">\n" +
        "    <div class=\"m-modal-dialog\">\n" +
        "        <a href=\"javascript:void(0);\" class=\"m-modal-close\"></a>\n" +
        "        <div class=\"modal-img-area\">\n" +
        "            <div class=\"modal-logo-area\"></div>\n" +
        "            <div class=\"modal-logo-bottom\"></div>\n" +
        "        </div>\n" +
        "        <table class=\"sign-modal-table\">\n" +
        "            <tr>\n" +
        "                <td><span>联系人</span>\n" +
        "                    <input type=\"text\" placeholder=\"姓名\"></td>\n" +
        "                <td><span>QQ</span>\n" +
        "                    <input type=\"text\" placeholder=\"例：1932253863\"></td>\n" +
        "            </tr>\n" +
        "            <tr>\n" +
        "                <td><span>电话</span>\n" +
        "                    <input type=\"text\" placeholder=\"手机号码\"></td>\n" +
        "                <td><span>学校</span>\n" +
        "                    <input type=\"text\" placeholder=\"例：河北软件\"></td>\n" +
        "            </tr>\n" +
        "            <tr>\n" +
        "                <td><span>院系</span>\n" +
        "                    <input type=\"text\" placeholder=\"例：管理系\"></td>\n" +
        "                <td><span>专业</span>\n" +
        "                    <input type=\"text\" placeholder=\"例：工程造价\"></td>\n" +
        "            </tr>\n" +
        "            <tr>\n" +
        "                <td><span>年级</span>\n" +
        "                    <input type=\"text\" placeholder=\"例：2011级\"></td>\n" +
        "            </tr>\n" +
        "        </table>\n" +
        "        <div class=\"modal-idea-area\">\n" +
        "            <button class=\"sign-now\">立即报名</button>\n" +
        "            <button class=\"idea-upload\">意见反馈</button>\n" +
        "        </div>\n" +
        "    </div>\n" +
        "</div>").appendTo("#modal-box");
    var m1 = new MyModal.modal(function () {
        // alert("你点击了确定");
    });
    $(".learn_more").click(function () {
        m1.show();
        document.documentElement.style.overflow = "hidden";// 禁止页面滚动
        //以下为点击时遮罩层后对应老师框状态
        $(this).addClass('clickBtnStyle');
        $(this).parent().addClass('set_teacher_backgroundOne');
        $(this).siblings('.teacher_info').children('.skillInfo').addClass('set_teacher_levelBackOne');
        $(this).siblings('.teacher_info').children().addClass('setColorOne');
    });
    $(".m-modal-close").click(function () {
        m1.hide();
        document.documentElement.style.overflow = "scroll";//使网页恢复可滚
        $(".learn_more").removeClass('clickBtnStyle');
        $('td').removeClass('set_teacher_backgroundOne');
        $('.skillInfo').removeClass('set_teacher_levelBackOne');
        $('.teacher_info').children().removeClass('setColorOne');
    });
    var m1 = new MyModal.modal(function () {
        // alert("你点击了确定");
    });
//        $("button").click(function(){
//            $("").appendTo("body");
//        });
    $('.li-two').click(function () {
        m1.show();
        document.documentElement.style.overflow = "hidden";// 禁止页面滚动
    })
    $(".m-modal-close").click(function () {
        m1.hide();
        document.documentElement.style.overflow = "scroll";//使网页恢复可滚
    });
    $(document).mouseup(function(e){//报名框外点击
        var child = $('.m-modal-dialog');   // 设置目标区域
        if(!child.is(e.target) && child.has(e.target).length === 0){
            // 功能代码
            e.preventDefault();//阻止鼠标的默认点击事件
            e.stopImmediatePropagation() ;//阻止冒泡事件发生
            // return false;
        }
    });
});